Heap Tree
Q21.
Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4. Now consider that a value 35 is inserted into this heap. After insertion, the new heap isQ22.
A max-heap is a heap where the value of each parent is greater than or equal to the value of its children. Which of the following is a max-heap?Q23.
Consider a complete binary tree where the left and the right subtrees of the root are max-heaps. The lower bound for the number of operations to convert the tree to a heap isQ24.
A data structure is required for storing a set of integers such that each of the following operations can be done in O(\log n) time, where n is the number of elements in the set. 1. Deletion of the smallest element 2. Insertion of an element if it is not already present in the set Which of the following data structures can be used for this purpose?Q25.
Consider the process of inserting an element into a Max Heap, where the Max Heap is represented by an array. Suppose we perform a binary search on the path from the new leaf to the root to find the position for the newly inserted element, the number of comparisons performed is:Q26.
Consider a binary max-heap implemented using an array. What is the content of the array after two delete operations on {25,14,16,13,10,8,12}Q27.
We have a binary heap on n elements and wish to insert n more elements (not necessarily one after another) into this heap. The total time required for this isQ28.
Consider a binary max-heap implemented using an array. Which one of the following array represents a binary max-heap?Q29.
The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _____.